const express = require("express")
const router = express.Router()
const articleHandle = require("../router_handler/article_cate")
const expressJoi = require("@escook/express-joi")
const { add_cates_schema,getId_cates_schema,update_cates_schema } = require("../schema/article_cate")
// 获取文章列表
router.get('/cates', articleHandle.cates)
// 添加文章分类
router.post('/addcates', expressJoi(add_cates_schema), articleHandle.addCates)
// 删除文章分类
router.post("/deletecate/:id",expressJoi(getId_cates_schema),articleHandle.removeCates)
// 根据 id 获取文章分类
router.get("/cates/:id",expressJoi(getId_cates_schema),articleHandle.getArticleById)
// 根据 id 更新文章分类
router.post("/updatecate",expressJoi(update_cates_schema),articleHandle.updateCateById)

module.exports = router